package com.arelikebrothers.demo.concurrent.begin;

/**
 * Created by lennon on 30/04/2017.
 */
public class SimpleJoin {
    public volatile static int i = 0;

    public static class AddThread extends Thread {
        @Override
        public void run() {
            for (i = 0; i < 1000000; i++) {
                // pass
            }
        }
    }

    public static void main(String[] args) throws InterruptedException {
        AddThread thread = new AddThread();
        thread.start();
        thread.join();
        System.out.println(i);
    }
}
